const babelCore = require('@babel/core')

const code = `
  foo instanceof Bar;
`
const result = babelCore.transformSync(code,{
    plugins: ["@babel/plugin-transform-instanceof"]
})

console.log(result.code);